package com.hehui.partimejob.service.model;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class CategoryModel {

    /**
     * cid
     */ /**
     * cid : 1
     * title : 问卷
     */

    private int cid;
    /**
     * title
     */
    private String title;
    private String icon;


    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public static CategoryModel objectFromData(String str) {

        return new Gson().fromJson(str, CategoryModel.class);
    }

    public static List<CategoryModel> arrayCategoryModelFromData(String str) {

        Type listType = new TypeToken<ArrayList<CategoryModel>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getCid() {
        return cid;
    }

    public void setCid(int cid) {
        this.cid = cid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}
